package com.lyj.service.impl;

import com.lyj.mapper.PaymentMapper;
import com.lyj.pojo.Payment;
import com.lyj.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PaymentServiceImpl  implements PaymentService {

    @Autowired
    PaymentMapper paymentMapper;

    @Override
    public List<Payment> queryAllPayment() {

        List<Payment> payments = paymentMapper.queryAllPayment();
        return payments;
    }

    @Override
    public List<Payment> queryPaymentByName(String oldName) {

        List<Payment> paymentList = paymentMapper.queryPaymentByName(oldName);
        return paymentList;
    }

    @Override
    public Boolean addPayment(Payment payment) {

        Boolean aBoolean = paymentMapper.addPayment(payment);
        return aBoolean;
    }

    @Override
    public Boolean updatePayment(Payment payment) {
        Boolean aBoolean = paymentMapper.updatePayment(payment);
        return aBoolean;

    }

    @Override
    public Boolean delPayment(int paymentId) {

        Boolean aBoolean = paymentMapper.delPayment(paymentId);
        return aBoolean;
    }
}
